perm filename MFMAN.MF[FIG,DEK]1 blob sn#767440 filedate 1984-09-09 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00005 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% Special characters for the METAFONT manual only
C00003 00003	message "Union Jack characters"
C00005 00004	% Letters for the METAFONT logo second try with the new MF
C00014 00005	end
C00015 ENDMK
CāŠ—;
% Special characters for the METAFONT manual only
fontsetup;
designsize:=10;

def nextchar=charcode:=charcode+1 enddef;
message "Union Jack characters";
transform t;
(0,0) transformed t=(0,0);
(0,100) transformed t=(0,250/36pt);
(100,0) transformed t=(250/36pt,0);
pen q; q=pencircle scaled 36 scaled .4 transformed t;

vardef top primary x=x+(0,r) enddef;
vardef bot primary x=x-(0,r) enddef;
vardef lft primary x=x-(r,0) enddef;
vardef rt primary x=x+(r,0) enddef;
r=.4*36;

z1=(0,100); z2=(100,100); z3=(200,100);
z4=(0,0); z5=(100,0); z6=(200,0);

clearit;
draw(z1..z6)transformed t withpen q;
draw(z2..z5)transformed t withpen q;
draw(z3..z4)transformed t withpen q;
charcode:=1;
chardw:=xpart(z3 transformed t);
charht:=250/36; charwd:=500/36;
shipit;

numeric x[],y[];

top z1=(0,100); top z2=(100,100); top z3=(200,100);
bot z4=(0,0); bot z5=(100,0); bot z6=(200,0);

clearit;
draw(z1..z6)transformed t withpen q;
draw(z2..z5)transformed t withpen q;
draw(z3..z4)transformed t withpen q;
charcode:=2;
shipit;

numeric x[],y[];

top lft z1=(0,100); top z2=(100,100); top rt z3=(200,100);
bot lft z4=(0,0); bot z5=(100,0); bot rt z6=(200,0);

clearit;
draw(z1..z6)transformed t withpen q;
draw(z2..z5)transformed t withpen q;
draw(z3..z4)transformed t withpen q;
charcode:=3;
shipit;


% Letters for the METAFONT logo; second try with the new MF
fontsetup;
if displaying>0: openit; fi
epsilon=1/256/256;
fontfamily "LOGO";
codingscheme "METAFONT logo only";
fontfacebyte 100;	% temporary patch for Xerox software only
designsize:=10;

def arc(suffix i,j) =
       (z.i{0,y.j-y.i}..
	(beta[x.i,x.j],beta[y.j,y.i]){z.j-z.i}..
	z.j{x.j-x.i,0}) enddef;

def double_arc(suffix i,j,k) =
	arc(i,j) & reverse arc(k,j) enddef;

alpha=.45;	% controls bar location and similar things
beta=.2;	% controls squareness of bowls

def setparameters(text parameter_equations) =
	string code.M,code.E,code.T,code.A,code.F,code.O,code.N;
	numeric h#, h, x#, x, y, o#, o, s#, s, u#, u, d#, d.h, d.v;
	numeric leftstemloc, barheight;
	numeric w[];
	parameter_equations;
	h=round(h#*vppp);
	x=round(x#*hppp); y=round(x#*vppp);
	s=s#*hppp; u=u#*hppp;
	o=round(o#*vppp*overcorr)+epsilon;
	d.h=round(d#*hppp+blacker);
	d.v=round(.9d#*vppp+blacker);
	w0=d.h; w1=d.v;
%	leftstemloc:=good0((3u#+s#)*hppp);
	leftstemloc:=good0((2.5u#+s#)*hppp);
	barheight:=good1(alpha*h);
	defaultpen:=pencircle xscaled d.h yscaled d.v;
	ligtable code.T: code.A kern -.5u#;
	ligtable code.F: code.O kern -u#;
enddef;

def beginchar(suffix c)(expr n) = % character code c; width is n units plus sidebars
	charcode:=ord code.c;
	w#:=n*u#+2s#; w:=round(w#*hppp)-1;
	charwd:=w#;
	charht:=h#; chardp:=0; charic:=0;
	clearit; numeric x[],y[];
enddef;

def endchar = chardw:=w+1;
	if proofing>0: proofrule((0,0),(chardw,0));
		proofrule((0,h),(chardw,h));
		proofrule((0,0),(0,h));
		proofrule((chardw,0),(chardw,h)); fi
	showit; shipit; enddef;

vardef rt primary x = x+.5d.h enddef;
vardef lft primary x = x-.5d.h enddef;
vardef top primary x = x+.5d.v enddef;
vardef bot primary x = x-.5d.v enddef;

def do_it =
beginchar(M,18);
x1+x5=x2+x4=2x3=w; x1=x2=leftstemloc;
y1=y5; y2=y4; bot.y1=-o; top y2=h+o; bot.y3=y-epsilon;
draw z1..z2 & z2..z3; draw z5..z4 & z4..z3;
labelrange(1,5);
endchar;

%beginchar(E,13);
beginchar(E,14);
x1+x6=x2+x5-epsilon+x=x3+x4=w+o; x1=x2=x3=leftstemloc;
%y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=alpha[y1,y3];
y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=barheight;
draw z6..z1 & z1..z3 &  z3..z4; draw z2..z5;
labelrange(1,6);
endchar;

%beginchar(T,10);
beginchar(T,13);
if odd(w+d.h): w:=w+1; fi	% allows a symmetric stem
x1+x3=2x2=2x4=w; lft.x1=-epsilon; % I tried s-o instead; was not as good
y1=y2=y3; top.y1=h; bot.y4=-o;
draw z1..z3; draw z2..z4;
labelrange(1,4);
endchar;

beginchar(A,16);
x1+x4=x2+x3=2x5=w; x1=x2=leftstemloc;
%y1=y4; y2=y3; bot.y1=-o; top.y5=h+o; y2=alpha[y1,y5];
y1=y4; y2=y3; bot.y1=-o; top.y5=h+o; y2=barheight;
draw double_arc(2,5,3); draw z1..z2 & z2..z3 & z3..z4;
labelrange(1,5);
endchar;

%beginchar(F,13);
beginchar(F,14);
x2+x5-epsilon+x=x3+x4=w; x1=x2=x3=leftstemloc;
%y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=alpha[y1,y3];
y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=barheight;
draw z1..z3 & z3..z4; draw z2..z5;
labelrange(1,5);
endchar;

beginchar(O,15);
%x1+x2=x3+x4=w; x1=2u+s; x3=x4;
x1+x2=x3+x4=w; x1=good0(1.5u+s); x3=x4;
%bot.y3=-o; top.y4=h+o; y1=y2=alpha[y3,y4];
bot.y3=-o; top.y4=h+o; y1=y2=barheight;
draw double_arc(1,4,2); draw double_arc(2,3,1);
labelrange(1,4);
endchar;

%beginchar(N,16);
beginchar(N,15);
x1+x4=x1+x3=x2+x5=w; x1=x2=leftstemloc;
y1=y4=y3-y; bot.y1=-o; y2=y5; top.y5=h+o;
draw z1..z2 & z2..z3; draw z4..z5;
labelrange(1,5);
endchar;
enddef;	% the end of "do_it"

% ten-point size
message "ten point METAFONT";
setparameters(h#=6;	% height of characters, in pt
	x#=0.6;	% extra length of certain features, in pt
	u#=4/9;	% unit width, in pt
%	s#=.1;	% extra sidebar, in pt
	s#=0;	% extra sidebar, in pt
	o#=1/9;	% overshoot of curves, in pt
	d#=2/3;	% thickness of pen, in pt
%	d#=1;	% thickness of pen, in pt  % delete this later
	code.M="M"; code.E="E"; code.T="T"; code.A="A";
	code.F="F"; code.O="O"; code.N="N")
do_it;

% eight-point size: opqrstuq = METAFONT!
message "eight point METAFONT";
setparameters(h#=.8*6;  % height of characters, in pt
	x#=.8*0.6;	% extra length of certain features, in pt
	u#=.82*4/9;	% unit width, in pt
	s#=.2;	% extra sidebar, in pt
	o#=1/12;	% overshoot of curves, in pt
	d#=.8*2/3;	% thickness of pen, in pt
%	d#=.8;	% thickness of pen, in pt % delete this later
	code.M="o"; code.E="p"; code.T="q"; code.A="r";
	code.F="s"; code.O="t"; code.N="u")
do_it;

if mag<=1:
% special size for the title page: ()*+,-.* = METAFONT!
message "title page METAFONT";
setparameters(h#=250/9;  % height of characters, in pt (same as cmssc40)
	x#=2.9;	% extra length of certain features, in pt
	u#=(1+sqrt5)/2;	% unit width, in pt
	s#=.2;	% extra sidebar, in pt
	o#=4/9;	% overshoot of curves, in pt
	d#=4;	% thickness of pen, in pt
	code.M="("; code.E=")"; code.T="*"; code.A="+";
	code.F=","; code.O="-"; code.N=".")
do_it;
fi
end

% MF logo rejects!

%beginchar(E,13);
beginchar(E,14);
x2+x6=x2+x5-epsilon+x=x2+x4=w+o; x2=leftstemloc; x1=x3=alpha*w;
%y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=alpha[y1,y3];
y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=barheight;
draw z6..z1; draw arc(2,1); draw arc(2,3); draw z3..z4; draw z2..z5;
labelrange(1,6);
endchar;

%beginchar(F,13);
beginchar(F,14);
x2+x5-epsilon+x=x1+x4=w; x1=x2=leftstemloc; x3=alpha*w;
%y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=alpha[y1,y3];
y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=barheight;
draw z1..z2; draw arc(2,3); draw z3..z4; draw z2..z5;
labelrange(1,5);
endchar;